<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.20"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>The small3d library: small3d::BoundingBoxSet Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="customdoxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="logo_s.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">The small3d library
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.20 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespacesmall3d.html">small3d</a></li><li class="navelem"><a class="el" href="classsmall3d_1_1_bounding_box_set.html">BoundingBoxSet</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-attribs">Public Attributes</a> &#124;
<a href="classsmall3d_1_1_bounding_box_set-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">small3d::BoundingBoxSet Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Set of bounding boxes for a <a class="el" href="classsmall3d_1_1_scene_object.html" title="An object that appears on the 3D scene. It is made up of a Model, together with information for posit...">SceneObject</a>, calculated based on the vertices of a <a class="el" href="classsmall3d_1_1_model.html" title="A 3D model. It can be loaded from a WavefrontFile or GlbFile. It can also be constructed procedurally...">Model</a>.  
 <a href="classsmall3d_1_1_bounding_box_set.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="_bounding_box_set_8hpp_source.html">BoundingBoxSet.hpp</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><b>extremes</b></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Structure to hold the coordinates of the extremes of each box. <br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a0d8a4eac5d06e723ae60aef2bc2b0a83"><td class="memItemLeft" align="right" valign="top"><a id="a0d8a4eac5d06e723ae60aef2bc2b0a83"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsmall3d_1_1_bounding_box_set.html#a0d8a4eac5d06e723ae60aef2bc2b0a83">getNumBoxes</a> () const</td></tr>
<tr class="memdesc:a0d8a4eac5d06e723ae60aef2bc2b0a83"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the number of boxes contained in the set. <br /></td></tr>
<tr class="separator:a0d8a4eac5d06e723ae60aef2bc2b0a83"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac180dc2880307f9adc399b208b58c6d9"><td class="memItemLeft" align="right" valign="top"><a id="ac180dc2880307f9adc399b208b58c6d9"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsmall3d_1_1_bounding_box_set.html#ac180dc2880307f9adc399b208b58c6d9">BoundingBoxSet</a> ()</td></tr>
<tr class="memdesc:ac180dc2880307f9adc399b208b58c6d9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Default constructor. <br /></td></tr>
<tr class="separator:ac180dc2880307f9adc399b208b58c6d9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae785478001d2c18368ed363afcde7dc0"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsmall3d_1_1_bounding_box_set.html#ae785478001d2c18368ed363afcde7dc0">BoundingBoxSet</a> (std::vector&lt; float &gt; &amp;vertexData, uint32_t subdivisions)</td></tr>
<tr class="memdesc:ae785478001d2c18368ed363afcde7dc0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor that creates a box set, constructed based on the vertex data that can be found in a <a class="el" href="classsmall3d_1_1_model.html" title="A 3D model. It can be loaded from a WavefrontFile or GlbFile. It can also be constructed procedurally...">Model</a>.  <a href="classsmall3d_1_1_bounding_box_set.html#ae785478001d2c18368ed363afcde7dc0">More...</a><br /></td></tr>
<tr class="separator:ae785478001d2c18368ed363afcde7dc0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a60b57cda9c3d783c7d88f306ceda3060"><td class="memItemLeft" align="right" valign="top"><a id="a60b57cda9c3d783c7d88f306ceda3060"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsmall3d_1_1_bounding_box_set.html#a60b57cda9c3d783c7d88f306ceda3060">~BoundingBoxSet</a> ()=default</td></tr>
<tr class="memdesc:a60b57cda9c3d783c7d88f306ceda3060"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor. <br /></td></tr>
<tr class="separator:a60b57cda9c3d783c7d88f306ceda3060"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4b5b507e6dae95b55943ec09d1d2d3bb"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsmall3d_1_1_bounding_box_set.html#a4b5b507e6dae95b55943ec09d1d2d3bb">contains</a> (const glm::vec3 point, const glm::vec3 thisOffset, const glm::vec3 thisRotation) const</td></tr>
<tr class="memdesc:a4b5b507e6dae95b55943ec09d1d2d3bb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Check if a point is inside any of the boxes.  <a href="classsmall3d_1_1_bounding_box_set.html#a4b5b507e6dae95b55943ec09d1d2d3bb">More...</a><br /></td></tr>
<tr class="separator:a4b5b507e6dae95b55943ec09d1d2d3bb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3f168bc8505d561601e94d9b77c4b07c"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsmall3d_1_1_bounding_box_set.html#a3f168bc8505d561601e94d9b77c4b07c">containsCorners</a> (const <a class="el" href="classsmall3d_1_1_bounding_box_set.html">BoundingBoxSet</a> otherBoxSet, const glm::vec3 thisOffset, const glm::vec3 thisRotation, const glm::vec3 otherOffset, const glm::vec3 otherRotation) const</td></tr>
<tr class="memdesc:a3f168bc8505d561601e94d9b77c4b07c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Check any of the corners of another set of bounding boxes is inside any of the boxes of this set.  <a href="classsmall3d_1_1_bounding_box_set.html#a3f168bc8505d561601e94d9b77c4b07c">More...</a><br /></td></tr>
<tr class="separator:a3f168bc8505d561601e94d9b77c4b07c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abf45f0d5ed515b0d7e5a9b319ba98f62"><td class="memItemLeft" align="right" valign="top">std::vector&lt; <a class="el" href="classsmall3d_1_1_model.html">Model</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsmall3d_1_1_bounding_box_set.html#abf45f0d5ed515b0d7e5a9b319ba98f62">getModels</a> ()</td></tr>
<tr class="memdesc:abf45f0d5ed515b0d7e5a9b319ba98f62"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the bounding boxes in a set of Models that can be rendered.  <a href="classsmall3d_1_1_bounding_box_set.html#abf45f0d5ed515b0d7e5a9b319ba98f62">More...</a><br /></td></tr>
<tr class="separator:abf45f0d5ed515b0d7e5a9b319ba98f62"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:a954fb0543919362f873e9f59f61c83b8"><td class="memItemLeft" align="right" valign="top"><a id="a954fb0543919362f873e9f59f61c83b8"></a>
std::vector&lt; extremes &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsmall3d_1_1_bounding_box_set.html#a954fb0543919362f873e9f59f61c83b8">boxExtremes</a></td></tr>
<tr class="memdesc:a954fb0543919362f873e9f59f61c83b8"><td class="mdescLeft">&#160;</td><td class="mdescRight">The extreme coordinates (max and min) of each box. <br /></td></tr>
<tr class="separator:a954fb0543919362f873e9f59f61c83b8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad6565272cb69deaf226f4ae892975f93"><td class="memItemLeft" align="right" valign="top"><a id="ad6565272cb69deaf226f4ae892975f93"></a>
std::vector&lt; std::vector&lt; float &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsmall3d_1_1_bounding_box_set.html#ad6565272cb69deaf226f4ae892975f93">vertices</a></td></tr>
<tr class="memdesc:ad6565272cb69deaf226f4ae892975f93"><td class="mdescLeft">&#160;</td><td class="mdescRight">Vertex coordinates. <br /></td></tr>
<tr class="separator:ad6565272cb69deaf226f4ae892975f93"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4cc9b979ea109f835753ec2c245e34b6"><td class="memItemLeft" align="right" valign="top"><a id="a4cc9b979ea109f835753ec2c245e34b6"></a>
std::vector&lt; std::vector&lt; unsigned int &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsmall3d_1_1_bounding_box_set.html#a4cc9b979ea109f835753ec2c245e34b6">facesVertexIndexes</a></td></tr>
<tr class="memdesc:a4cc9b979ea109f835753ec2c245e34b6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Faces vertex indexes (rectangles) <br /></td></tr>
<tr class="separator:a4cc9b979ea109f835753ec2c245e34b6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a543d45e64464ea9d7452b0a0816543dd"><td class="memItemLeft" align="right" valign="top"><a id="a543d45e64464ea9d7452b0a0816543dd"></a>
std::vector&lt; std::vector&lt; unsigned int &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsmall3d_1_1_bounding_box_set.html#a543d45e64464ea9d7452b0a0816543dd">facesVertexIndexesTriangulated</a></td></tr>
<tr class="memdesc:a543d45e64464ea9d7452b0a0816543dd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Faces vertex indexes (triangles, for rendering) <br /></td></tr>
<tr class="separator:a543d45e64464ea9d7452b0a0816543dd"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Set of bounding boxes for a <a class="el" href="classsmall3d_1_1_scene_object.html" title="An object that appears on the 3D scene. It is made up of a Model, together with information for posit...">SceneObject</a>, calculated based on the vertices of a <a class="el" href="classsmall3d_1_1_model.html" title="A 3D model. It can be loaded from a WavefrontFile or GlbFile. It can also be constructed procedurally...">Model</a>. </p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="ae785478001d2c18368ed363afcde7dc0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae785478001d2c18368ed363afcde7dc0">&#9670;&nbsp;</a></span>BoundingBoxSet()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">small3d::BoundingBoxSet::BoundingBoxSet </td>
          <td>(</td>
          <td class="paramtype">std::vector&lt; float &gt; &amp;&#160;</td>
          <td class="paramname"><em>vertexData</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>subdivisions</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Constructor that creates a box set, constructed based on the vertex data that can be found in a <a class="el" href="classsmall3d_1_1_model.html" title="A 3D model. It can be loaded from a WavefrontFile or GlbFile. It can also be constructed procedurally...">Model</a>. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">vertexData</td><td>The vertex data. Array of floats to be interpreted as an array of 4 component vertex coordinates. </td></tr>
    <tr><td class="paramname">subdivisions</td><td>How many times to subdivide the initially one created bounding box, getting more accurate collision detection at the expense of performance. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a4b5b507e6dae95b55943ec09d1d2d3bb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4b5b507e6dae95b55943ec09d1d2d3bb">&#9670;&nbsp;</a></span>contains()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool small3d::BoundingBoxSet::contains </td>
          <td>(</td>
          <td class="paramtype">const glm::vec3&#160;</td>
          <td class="paramname"><em>point</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const glm::vec3&#160;</td>
          <td class="paramname"><em>thisOffset</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const glm::vec3&#160;</td>
          <td class="paramname"><em>thisRotation</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Check if a point is inside any of the boxes. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">point</td><td>The point (as a vector) </td></tr>
    <tr><td class="paramname">thisOffset</td><td>The offset (location) of the box set </td></tr>
    <tr><td class="paramname">thisRotation</td><td>The rotation of the box set </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>True the point is inside a box, False if not. </dd></dl>

</div>
</div>
<a id="a3f168bc8505d561601e94d9b77c4b07c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3f168bc8505d561601e94d9b77c4b07c">&#9670;&nbsp;</a></span>containsCorners()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool small3d::BoundingBoxSet::containsCorners </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classsmall3d_1_1_bounding_box_set.html">BoundingBoxSet</a>&#160;</td>
          <td class="paramname"><em>otherBoxSet</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const glm::vec3&#160;</td>
          <td class="paramname"><em>thisOffset</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const glm::vec3&#160;</td>
          <td class="paramname"><em>thisRotation</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const glm::vec3&#160;</td>
          <td class="paramname"><em>otherOffset</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const glm::vec3&#160;</td>
          <td class="paramname"><em>otherRotation</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Check any of the corners of another set of bounding boxes is inside any of the boxes of this set. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">otherBoxSet</td><td>The other box set </td></tr>
    <tr><td class="paramname">thisOffset</td><td>The offset (location) of this box set </td></tr>
    <tr><td class="paramname">thisRotation</td><td>The rotation of this box set </td></tr>
    <tr><td class="paramname">otherOffset</td><td>The offset (location) of the other box set </td></tr>
    <tr><td class="paramname">otherRotation</td><td>The rotation of the other box set </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>True if a corner of the other bounding box set is contained in this set, False otherwise. </dd></dl>

</div>
</div>
<a id="abf45f0d5ed515b0d7e5a9b319ba98f62"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abf45f0d5ed515b0d7e5a9b319ba98f62">&#9670;&nbsp;</a></span>getModels()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::vector&lt; <a class="el" href="classsmall3d_1_1_model.html">Model</a> &gt; small3d::BoundingBoxSet::getModels </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the bounding boxes in a set of Models that can be rendered. </p>
<dl class="section return"><dt>Returns</dt><dd>The set of bounding boxes as Models </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="_bounding_box_set_8hpp_source.html">BoundingBoxSet.hpp</a></li>
<li>BoundingBoxSet.cpp</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.8.20
</small></address>
</body>
</html>
